# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=geth
pkgver=1.13.14
pkgrel=2
pkgdesc="Official Go implementation of the Ethereum protocol"
url="https://geth.ethereum.org/"
arch="all"
license="LGPL-3.0-or-later"
makedepends="go linux-headers"
checkdepends="fuse"
options="!check chmod-clean net"
source="$pkgname-$pkgver.tar.gz::https://github.com/ethereum/go-ethereum/archive/v$pkgver.tar.gz"
builddir="$srcdir/go-ethereum-$pkgver"

# secfixes:
#   1.10.22-r0:
#     - CVE-2022-37450

export GOROOT=/usr/lib/go
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make
}

check() {
	make test
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	install -m755 -t "$pkgdir"/usr/bin build/bin/*
}

sha512sums="
80a410dbeb06e8a46bd5b4e962fcf030fa8787eef192dbcd01c3d98bf31e822a8c3b92c35251876e122eac3fad707faf95b5e5c0baed8e29aa024c856b6f54bc  geth-1.13.14.tar.gz
"
